package com.ruoyi.project.domain.dto;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.project.domain.entity.DictData;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * (DictData)表DTO层
 *
 * @author yanweichao
 * @since 2025-06-25 15:52:21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class DictDataDTO extends DictData {

    private static final long serialVersionUID = 1L;

    private String keyword;

    private Integer maxGrade;

    private String fullType_1;
    private String fullName_1;
    private String fullType_2;
    private String fullName_2;
    private String fullType_3;
    private String fullName_3;
    private String fullType_4;
    private String fullName_4;
    private String fullType_5;
    private String fullName_5;

    private List<DictDataDTO> children;

    public boolean isNew() {
        return this.getId() == null;
    }

    public static DictDataDTO of(DictData data) {
        DictDataDTO dto = new DictDataDTO();
        BeanUtil.copyProperties(data, dto);
        return dto;
    }
}
